
# 这个貌似还是运营测的地址
# http://172.17.216.158:8088/sandboxSys/#/userControl/openUser
# 18810807780   sqt199410！
# http://172.17.216.158:8088/sandbox/#/home


from pydantic import BaseModel, ValidationError, validator
from fastapi import APIRouter


class User(BaseModel):
    # 声明属性
    idcard: str

    @validator('idcard')
    def idcard_check(cls, v):
        if len(v) != 18 and len(v) != 15 :
            raise ValueError('身份证号码长度错误')
        return v

# router=APIRouter(prefix="/test")
# @router.post(path="/test")
# async def create_user(user: User):
#     user_dict = user.dict()
#     return user_dict